package com.yc.sole.erp.request;

import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * 模具表 Request对象
 *
 * @author yizuomin
 * @date 2023-05-07
 **/
@Data
public class MoldReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 模具名称
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String moldName;
    /**
     * 分类id
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Long categoryId;
    /**
     * 单位
     */
    @Length(max = 10, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String unit;
    /**
     * 供应商
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Long supplierId;
    /**
     * 制造日期
     */
    @Length(max = 10, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String madeDate;
    /**
     * 位置
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    private String position;
    /**
     * 产量 一模几双
     */
    @Min(value = 1, groups = {SaveGroup.class, UpdateGroup.class})
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Integer capacity;
    /**
     * 重量
     */
    @Min(value = 1, groups = {SaveGroup.class, UpdateGroup.class})
    private Integer weight;
    /**
     * 备注
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    private String remark;
}
